//
//  XMActionSheet.swift
//  AnneKit-Swift
//
//  Created by 宁小陌 on 2021/2/4.
//  Copyright © 2021 宁小陌. All rights reserved.
//

import UIKit

class XMActionSheet: UIView {
    private var cancelButtonTitle   = NSString()
    private var otherButtonTitles   = NSArray()
    private var allButtonTitles     = NSArray()
    private var buttonBackgroundView    = UIView()
    private var darkShadowView          = UIView()
    
    let title = NSString()
    
    override init(frame: CGRect) {
        super.init(frame: UIScreen.main.bounds)
        backgroundColor = UIColor.kClearColor
        setupUI()
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func setupUI() {
        darkShadowView.backgroundColor = UIColor.kColorWithRGB(red: 245, green: 245, blue: 245)
        addSubview(darkShadowView)
        
        if ((title.length) != 0) {
            let titleLabel = UILabel()
            titleLabel.text = title as String;
            titleLabel.numberOfLines = 0
            titleLabel.textColor = UIColor.kColorWithRGB(red: 125, green: 125, blue: 125)
            titleLabel.textAlignment = NSTextAlignment.center
            titleLabel.font = UIFont.systemFont(ofSize: 13.0)
            titleLabel.backgroundColor = UIColor.kClearColor
            buttonBackgroundView.addSubview(titleLabel)
        }
        let list = NSMutableArray()
        let dic = NSMutableDictionary()
        dic.setValue("zhouyu", forKey: "title")
        dic.setValue("huanggai", forKey: "title")
        dic.setValue("zhangliang", forKey: "title")
        dic.setValue("liubang", forKey: "title")
        list.add(dic)
        for (idx,item) in list.enumerated() {
            print("下标：\(idx) 值：\(item)")
            let dict = list[idx]
            print("姓名 -- \(dict)")
        }
    }
}
